/**
 * 
 */
package com.arethusa;

import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JTabbedPane;

/**
 * @author tpijl
 *
 */
public class LangebaanWedstrijdFrame extends JFrame {

	static final long serialVersionUID=1;
	private LangebaanWedstrijdFrame parent = this;
	
	private JPanel jContentPane = null;
	private JTabbedPane mainTabbedPane = null;
	private JPanel invoerenUitslagTab = null;
	private JPanel invoerenStartPanel = null;
	private JPanel procesVerbaalPanel = null;
	private JPanel wijzigenStartPanel = null;
	private JPanel lijstenPanel = null;
	private JPanel administratiePanel = null;
	private JPanel programmaPanel = null;
	private JPanel olowisPanel = null;
	/**
	 * This is the default constructor
	 */
	public LangebaanWedstrijdFrame() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(850, 728);
		this.setContentPane(getJContentPane());
		this.setTitle("On-Line Open Water Uitwerk Systeem (OLOWUS)");
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			parent.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			jContentPane = new JPanel();
			jContentPane.setLayout(new BorderLayout());
			jContentPane.add(getMainTabbedPane(), java.awt.BorderLayout.CENTER);
		}
		return jContentPane;
	}

	/**
	 * This method initializes mainTabbedPane	
	 * 	
	 * @return javax.swing.JTabbedPane	
	 */
	private JTabbedPane getMainTabbedPane() {
		if (mainTabbedPane == null) {
			mainTabbedPane = new JTabbedPane();
			mainTabbedPane.addTab("Invoeren Uitslag", null, getInvoerenUitslagTab(), null);
			mainTabbedPane.addTab("Invoeren Start", null, getInvoerenStartPanel(), null);
			mainTabbedPane.addTab("Proces Verbaal", null, getProcesVerbaalPanel(), null);
			mainTabbedPane.addTab("Programma", null, getProgrammaPanel(), null);
			mainTabbedPane.addTab("Lijsten", null, getLijstenPanel(), null);
			mainTabbedPane.addTab("Laden uit OLOWIS", null, getLadenOLOWIS(), null);
			mainTabbedPane.addTab("Wijzigen Starts", null, getWijzigenStartPanel(), null);
			mainTabbedPane.addTab("Administratie", null, getAdministratiePanel(), null);
			
			mainTabbedPane.addChangeListener(new javax.swing.event.ChangeListener() {
				public void stateChanged(javax.swing.event.ChangeEvent e) {
					int tab = ((JTabbedPane)e.getSource()).getSelectedIndex();
					switch (tab) {
					case 0:
						parent.getRootPane().setDefaultButton(((InvoerenUitslag)getInvoerenUitslagTab()).getVoegToeButton());
						break;
					default:
						parent.getRootPane().setDefaultButton(null);
					}
				}
			});
		}
		parent.getRootPane().setDefaultButton(((InvoerenUitslag)getInvoerenUitslagTab()).getVoegToeButton());
		return mainTabbedPane;
	}

	/**
	 * This method initializes invoerenUitslagTab	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getInvoerenUitslagTab() {
		if (invoerenUitslagTab == null) {
			invoerenUitslagTab = new InvoerenUitslag();
		}
		return invoerenUitslagTab;
	}

	/**
	 * This method initializes invoerenStartPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getInvoerenStartPanel() {
		if (invoerenStartPanel == null) {
			invoerenStartPanel = new InvoerenStart();
		}
		return invoerenStartPanel;
	}

	/**
	 * This method initializes ProcesverbaalPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getProcesVerbaalPanel() {
		if (procesVerbaalPanel == null) {
			procesVerbaalPanel = new ProcesVerbaal();
		}
		return procesVerbaalPanel;
	}

	/**
	 * This method initializes WijzigenStartPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getWijzigenStartPanel() {
		if (wijzigenStartPanel == null) {
			wijzigenStartPanel = new WijzigenStart();
		}
		return wijzigenStartPanel;
	}
	/**
	 * This method initializes lijstenPanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getLijstenPanel() {
		if (lijstenPanel == null) {
			lijstenPanel = new Lijsten();
		}
		return lijstenPanel;
	}


	/**
	 * This method initializes administratiePanel	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getAdministratiePanel() {
		if (administratiePanel == null) {
			administratiePanel = new Administratie();
		}
		return administratiePanel;
	}

	private JPanel getProgrammaPanel() {
		if (programmaPanel == null) {
			programmaPanel = new OnderhoudProgramma();
		}
		return programmaPanel;
	}

	private JPanel getLadenOLOWIS() {
		if (olowisPanel == null) {
			olowisPanel = new ImportOLOWIS();
		}
		return olowisPanel;
	}

}  //  @jve:decl-index=0:visual-constraint="10,10"
